var net = require('net')

var server = net.createServer(socket => {
    console.log('client connected')

    socket.on('data', data => {
        console.log('server got data from client: ', data.toString())
    })

    socket.on('end', data => {
        console.log('connection closed')
    })

    socket.write('Hello\r\n')
})

server.listen(8089, () => {
    console.log('server bound')
})